<template>
	<view class="page">
		<view class="list">
			<view class="list-title">
				<uni-icons type="contact" size="30" color=""></uni-icons>
				<text>通讯录成员</text>
				</view>
			<view class="list-item" v-for="member in members" :key="member.id">
				<image :src="member.photo"></image>
				<text>{{ member.name }}</text>
				<view class="button" @click="goToDetail(member)">查看</view>
			</view>
			
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				members:[
				{ name: '小钟' , photo: 'http://n.sinaimg.cn/sinacn23/481/w640h641/20180713/2012-hfhfwmv0396781.jpg'},
				{ name: '老板' , photo: 'https://wallpaperm.cmcm.com/765b808cc3d79b583eeda49f9dd3fda0.jpg' },
			],
			}
		},
		
		//请求数据
		onShow:function(){
			let that = this
			that.ajax(that.url.searchAllMembers,"POST",null,function(resp){
				let result = resp.data.result
				that.members = result
			})
		},
		
		 
		
		   methods: {
		         goToDetail(member) {
		             uni.navigateTo({
		                 url: '../member_detail/member_detail?memberId=' + member.id
		             })
		         }
		     }
	}
</script>

<style lang="less">
	@import url("contacts.less");
</style>
